package com.Media.DAO;
import org.hibernate.Session;
import org.hibernate.Transaction;

import com.Media.Config.HibernateSessionFactory;
import com.Media.bean.Cat;
public class CatDAL {
	public void Test() {
		Session session = HibernateSessionFactory.getSession();

		Transaction tx= session.beginTransaction();

		Cat princess= new Cat();
		princess.setName("Princess");
		princess.setSex('F');
		princess.setWeight(3);
		session.save(princess);
		tx.commit();
		HibernateSessionFactory.closeSession();
	}

}
